package com.sjq.demo.controller;


import com.baomidou.shaun.core.context.ProfileHolder;
import com.baomidou.shaun.core.profile.TokenProfile;
import com.sjq.demo.response.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yer
 * @since 2021-02-27
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping("/test1")
    public Result test1(){
        TokenProfile profile = ProfileHolder.getProfile();
        String token = profile.getToken();
        return Result.ok("test1");
    }

    @GetMapping("/test2")
    public Result test2(){
        return Result.ok("test2");
    }

    @GetMapping("/test3")
    public Result test3(){
        return Result.ok("test3");
    }
}
